package nirvana.core.domains.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import jakarta.persistence.MappedSuperclass;
import lombok.Data;
import lombok.EqualsAndHashCode;



/**
 * domain entity base class
 *
 * @author linkanyway
 * @version 1.0
 * @date 2021/10/18 12:31
 */
@MappedSuperclass
@EqualsAndHashCode(callSuper = true)
@Data
public abstract class DomainBaseEntity<T extends Model<?>> extends BaseAuditEntity<T> {

    /**
     * constructor
     */
    public DomainBaseEntity() {
        super();
    }

    /**
     * disable mark
     */
    @TableField(value = "is_disable")
    @Column(type = MySqlTypeConstant.BIT,
            isNull = false,
            comment = "是否禁用",
            defaultValue = "0")
    private Boolean isDisable=false;


    /**
     * soft delete mark
     */
    @TableField(value = "is_delete")
    @Column(type = MySqlTypeConstant.BIT,
            isNull = false,
            comment = "是否删除",
            defaultValue = "0")
    private Boolean isDelete=false;
}
